﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for AccountDAO
/// </summary>
public class AccountDAO:AbstractDAO
{
	public AccountDAO()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public account readByUserName(String username) {
        return db.accounts.First(a=>a.Username.Equals(username));
    }
    public int create(account acc) {
        db.accounts.Add(acc);
        return db.SaveChanges();
    }
    public int delete(account acc)
    {
       account old = db.accounts.Remove(acc);
       return db.SaveChanges();
    }
}